<html lang="zh-cn">
<head>
    <meta charset="UTF-8">
    <meta content="telephone=no,email=no" name="format-detection">
    <meta content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=no" name="viewport">
    <link rel="stylesheet" href="./css/load.css"/>
    <title>下载</title>
    <script src="../baidu.js"></script>
    <script>
        document.getElementsByTagName('html')[0].style.fontSize=document.documentElement.clientWidth/10+'px';
    </script>
    <!--<script src="./js/flexible.js"></script>-->
    <script src="./js/jquery.js"></script>
</head>
<body>
    <div class="root">
        <div class="ios-lead">
            <img src="./css/images/ios-lead-01-0929.jpg" />
            <div class="down-tip" style="display:none;font-size: 0.4rem;color:#fff; font-weight: 400;height:1.5rem;line-height:1.5rem;position: fixed;bottom:1.8rem;left:0;right:0;text-align:center;background:#000; filter:alpha(Opacity=60);-moz-opacity:0.6;opacity: 0.6;">
                    正在安装，请按 Home 键在桌面查看
                    <img src="./css/images/loading.gif" style="height:0.5rem;width:0.5rem;position: relative;top:0.1rem;">
            </div>
            <div class="button-float ios-btn" style="display:block;">
                一键下载
            </div>
            <div class="button-float ios-mobile" style="display:none;">
                立即信任
            </div>
            <div class="button-float android-btn">
                一键下载
            </div>
        </div>
        <img src="./css/images/weixin-tip.png" style="width:300px;position:absolute; right:0px; top:0px; display:none; z-index:1000" id="weixin1">
        <div style="background:url(./css/images/weixin-tip.png); width:100%; height:100%; position:absolute; left:0px; top:0px; display:none; background:#000; filter:alpha(Opacity=50);-moz-opacity:0.5;opacity: 0.5;"
        id="weixin"></div>
    </div>
</body>
</html>

<script src="./js/cookie.js"></script>
<script src="./js/timer.js"></script>
<script>
    var u = navigator.userAgent, 
        isiOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/), 
        height = document.documentElement.clientHeight, 
        selector = isiOS ? ".ios-btn" : ".android-btn";

    $(".root-bg").css("minHeight", height + "px"),
    $("#weixin").css("minHeight", $(".ios-lead").height() + "px"),
    $(selector).show();
    
    var updateUrl
    $.ajax({
        url: "/hs/api/v1/getNewVersion",
        type: "post",
        dataType: "json",
        data: {
            appName: "闪电飞猪",
            os: "ios"
        },
        success: function(a) {
            if(200 === Number(a.code)) {
                updateUrl = a.data.updateUrl
            }
        }
    })
    function load() {
         // cookie
        $(this).getC( 2 )

        // 产品地址修改
        window.location.href = updateUrl;
        $(".ios-btn").html('<img src="./css/images/loading.gif" style="height:0.8rem;width:0.8rem;padding-top:0.2rem;">')
        setTimeout(function(){
            $("ios-btn").hide();
            $(".down-tip").show();
            $(".ios-mobile").html('<div onclick="location.href=\'https://loanplatformimg.mayiaf.com/ll.mobileprovision\'">立即信任</div>')
            $(".ios-mobile").show();
            },3000);
    }

    $(window).timer()

    $(".ios-btn").on("click", function() {
       load2()
    }),


    isWeixn();

    function isWeixn() {
        var u = navigator.userAgent
              , isiOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/);
        const charts = /micromessenger/.test(navigator.userAgent.toLowerCase())
        const android = /android/.test(navigator.userAgent.toLowerCase())
        if (charts || android) {
            document.getElementById("weixin").style.display = "block";
            document.getElementById("weixin1").style.display = "block";
        }
    }

</script>
